import request from '@/utils/request'

// 查询【供应商结算】列表
export function listSettlement(query) {
  return request({
    url: '/system/settlement/list',
    method: 'get',
    params: query
  })
}

// 查询【供应商结算】详细
export function getSettlement(id) {
  return request({
    url: '/system/settlement/' + id,
    method: 'get'
  })
}

// 新增【供应商结算】
export function addSettlement(data) {
  return request({
    url: '/system/settlement',
    method: 'post',
    data: data
  })
}

// 修改【供应商结算】
export function updateSettlement(data) {
  return request({
    url: '/system/settlement',
    method: 'put',
    data: data
  })
}


//生成供应商结算单
export function createSettlement(data) {
  return request({
    url: '/system/settlement/getNewSettlement',
    method: 'post',
    data: data
  })
}


// 删除【供应商结算】
export function delSettlement(id) {
  return request({
    url: '/system/settlement/' + id,
    method: 'delete'
  })
}


// 查询【供应商结算明细】列表
export function listDetail(query) {
  return request({
    url: '/settlement/detail/list',
    method: 'get',
    params: query
  })
}

// 查询【供应商结算明细】详细
export function getDetail(id) {
  return request({
    url: '/settlement/detail/' + id,
    method: 'get'
  })
}

// 新增【供应商结算明细】
export function addDetail(data) {
  return request({
    url: '/settlement/detail',
    method: 'post',
    data: data
  })
}

// 修改【供应商结算明细】
export function updateDetail(data) {
  return request({
    url: '/settlement/detail',
    method: 'put',
    data: data
  })
}

// 删除【供应商结算明细】
export function delDetail(id) {
  return request({
    url: '/settlement/detail/' + id,
    method: 'delete'
  })
}
